package cn.gson.boot.model.pojos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;
import java.util.Objects;

@Entity
@Table(name = "productt_", schema = "boot", catalog = "")
public class Productt {//产品从表
    private int producttId;//从表id
    private BigDecimal producttPrice;//产品价格
    private Integer producttInventory;//库存
    private BigDecimal productttCost;//成本价格
    private String producttStatus;//产品状态
    private Product product;//产品id
    private int producttsc;//是否删除产品
    private String productImgs;//产品图片
    private List<ChanpincongbiaoShuxinzhi> chanpincongbiaoShuxinzhi;

    @Id
    @Column(name = "productt_id", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getProducttId() {
        return producttId;
    }

    public void setProducttId(int producttId) {
        this.producttId = producttId;
    }

    @Basic
    @Column(name = "productt_price", nullable = true, precision = 2)
    public BigDecimal getProducttPrice() {
        return producttPrice;
    }

    public void setProducttPrice(BigDecimal producttPrice) {
        this.producttPrice = producttPrice;
    }

    @Basic
    @Column(name = "productt_inventory", nullable = true)
    public Integer getProducttInventory() {
        return producttInventory;
    }

    public void setProducttInventory(Integer producttInventory) {
        this.producttInventory = producttInventory;
    }

    @Basic
    @Column(name = "producttt_cost", nullable = true, precision = 2)
    public BigDecimal getProductttCost() {
        return productttCost;
    }

    public void setProductttCost(BigDecimal productttCost) {
        this.productttCost = productttCost;
    }

    @Basic
    @Column(name = "productt_status", nullable = true, length = 200)
    public String getProducttStatus() {
        return producttStatus;
    }

    public void setProducttStatus(String producttStatus) {
        this.producttStatus = producttStatus;
    }
    @Basic
    @Column(name = "productt_sc", nullable = true)
    public int getProducttsc() {
        return producttsc;
    }

    public void setProducttsc(int producttsc) {
        this.producttsc = producttsc;
    }

    @Basic
    @Column(name = "product_imgs", nullable = true, length = 200)
    public String getProductImgs() {
        return productImgs;
    }

    public void setProductImgs(String productImgs) {
        this.productImgs = productImgs;
    }


    @ManyToOne
    @JoinColumn(name = "product_id", referencedColumnName = "product_id")
    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    @OneToMany(mappedBy = "productts")
    public List<ChanpincongbiaoShuxinzhi> getChanpincongbiaoShuxinzhi() {
        return chanpincongbiaoShuxinzhi;
    }

    public void setChanpincongbiaoShuxinzhi(List<ChanpincongbiaoShuxinzhi> chanpincongbiaoShuxinzhi) {
        this.chanpincongbiaoShuxinzhi = chanpincongbiaoShuxinzhi;
    }

    @Override
    public String toString() {
        return "Productt{" +
                "producttId=" + producttId +
                ", producttPrice=" + producttPrice +
                ", producttInventory=" + producttInventory +
                ", productttCost=" + productttCost +
                ", producttStatus='" + producttStatus + '\'' +
                ", producttsc=" + producttsc +
                '}';
    }
}
